package com.offcn.sms.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

//@RestController
//@RequestMapping("/sms")
public class SmsController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/")
    public void send(){
        HashMap<String, String> info = new HashMap<>();
        info.put("phone","13752021205");
        info.put("code","1234");
        rabbitTemplate.convertAndSend("dongyimai.sms.queue",info);
    }
}
